package cn.iocoder.yudao.module.trade.api.drainage;

import cn.iocoder.yudao.module.trade.service.drainage.AbstractDrainageService;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Objects;

@Service
@Slf4j
public class DrainageApiImpl implements DrainageApi {

    @Resource
    private AbstractDrainageService abstractDrainageService;

    public void cacheMemberDrainageFlag(Long userId, JSONObject uriQuery) {
        log.info("缓存用户推广地址: userid: {}, query: {}", userId, uriQuery);
        if (Objects.nonNull(uriQuery)) {
            abstractDrainageService.cacheMemberDrainageFlag(userId, uriQuery);
        }
    };
}
